﻿using System.Web;

namespace Besture.Common.Helper
{
    public class CacheHelper
    {
        /// <summary>
        /// 设置缓存
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static object GetCache(string key)
        {
            return HttpContext.Current.Cache.Get(key);
        }

        /// <summary>
        /// 获取缓存
        /// </summary>
        /// <param name="key"></param>
        /// <param name="obj"></param>
        public static void SetCache(string key,object obj)
        {
            HttpContext.Current.Cache.Insert(key,obj);
        }
    }
}
